package com.uzai.console.enums;

import com.alibaba.excel.util.StringUtils;

/**
 * 合同类型枚举
 * @Auther: liuyanyan
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum ContractTypeEnum {

    REBATE_SYSTEM_REGISTRATION(0,"返利系统注册协议"),
    PUSH_BOSS_REGISTRATION_agreement(1,"推老板注册协议"),
    MASTER_LEDGER_REGISTRATION_AGREEMENT(2,"主账房注册协议"),
    SUBLEDGER_HOUSE_REGISTRATION_AGREEMENT(3,"子账房注册协议"),
    ;

    private Integer key;
    private String desc;

    ContractTypeEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static ContractTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (ContractTypeEnum type: ContractTypeEnum.values()) {
            if (type.getKey().intValue() == id.intValue()) {
                return type;
            }
        }
        return null;
    }
}
